const MayBe = require('folktale/maybe')
//getOrElse方法 传入null的兼容处理
const toRMB = v => MayBe.fromNullable(v)
.map(v => v.replace('$', ''))
.map(parseFloat)
.map(v => v * 7)
.map(v => v.toFixed(2))
.map(v => '¥' + v)
.getOrElse()

console.log(toRMB('$299.9'))
// console.log(toRMB(null))
















